<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>index</title>
	</head>
	<body>
		<input type="text" name="" class="txt" value="" /><button type="button" class="btn">搜索</button>
	</body>
	<script type="text/javascript">
		let btn = document.getElementsByClassName("btn")[0];
		var txt = document.getElementsByClassName("txt")[0];
		btn.onclick=function()
		{
			let con = encodeURI(txt.value);
			window.location.href='./demo.html?con='+txt.value;
		}
	</script>
</html>
